package classtest;

public class Test {
    public static void main(String[] args) {
        //将1-100拼接成字符串,格式为”1,2,3,4,5,6,7,8,9,10”,要求使用StringBuffer类
        //创建StringBuffer对象
        StringBuffer sb = new StringBuffer();
        for (int i = 1; i <= 100; i++) {
            if (i == 100){
                sb.append(i);
                break;
            }
            sb.append(i).append(",");
        }
        System.out.println(sb);

    }
}
